import { ref } from 'vue'
const curTabIndex = Number(localStorage.getItem('curTabIndex')) || 0;
const tabIndex = ref(curTabIndex);

function setTabIndex(index) {
  tabIndex.value = index;
  localStorage.setItem('curTabIndex', index);
}

export default function useTabIndex() {
  return [tabIndex, setTabIndex];
}